import { defineConfig } from 'vite'
import * as path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

const resolve = (dir: string) => path.resolve(__dirname, dir)

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: 9527
  },
  envPrefix: 'VUE',
  plugins: [vue(), vueJsx()],
  resolve: {
    alias: {
      '@': resolve('src'),
      components: resolve('src/components'),
      styles: resolve('src/styles'),
      plugins: resolve('src/plugins'),
      views: resolve('src/views'),
      layouts: resolve('src/layouts'),
      utils: resolve('src/utils'),
      apis: resolve('src/apis'),
      path: 'path-browserify'
    }
  }
})
